<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Quản lý hình ảnh</title>
        <link rel="stylesheet" href="../../../public/css/screen.css" type="text/css" media="screen" title="default" />
        <link rel="stylesheet" href="../../../public/js/jquery/jquery-ui.css"/>
        <link rel="stylesheet" href="../../../public/css/lightbox.css"/>
        <link rel="stylesheet" href="../../../public/css/edit.css"/>

        <!--  jquery core -->
        <script src="../../../public/js/jquery/jquery-1.8.2.js" type="text/javascript"></script>
        <script src="../../../public/js/jquery/jquery-ui.js" type="text/javascript"></script>
        <script src="../../../public/js/jquery/lightbox.js" type="text/javascript"></script>
        <!--  checkbox styling script -->
        <script src="../../../public/js/jquery/ui.core.js" type="text/javascript"></script>
        <script src="../../../public/js/jquery/ui.checkbox.js" type="text/javascript"></script>
        <script src="../../../public/js/jquery/jquery.bind.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function(){
                $('input').checkBox();
                $('#toggle-all').click(function(){
                    $('#toggle-all').toggleClass('toggle-checked');
                    $('#frm_img input[type=checkbox]').checkBox('toggle');
                    return false;
                });
               
                // Upload image using ajax
                
                $('#frm_add_img_submit').click(function(){
                    var photo =  document.getElementById("image");
                    var file  = photo.files[0];
                    if(file!= null){
                        var form_data = new FormData();
                        jQuery.each($('#image')[0].files, function(i, file) {
                            form_data.append('image-'+i, file);
                        });
                        
                        $.ajax({
                            type:'POST',
                            url: 'action.php?act=1',
                            data:form_data,
                            cache: false,
                            contentType: false,
                            processData: false,
                            success: function(data){
                                $('#main_list_img_block').html(data.html);
                                $('#frm_img')[0].reset();
                                delete form_data;
                                location.reload();
                            },
                            error: function(XMLHttpRequest, textStatus, errorThrown){
                                
                            }
                        });
                    }else{
                        alert('Vui lòng chọn file ảnh để tải lên');
                    }
                });
                
            });
        </script>  
        <![if !IE 7]>
        <!--  styled select box script version 1 -->
        <script src="../../../public/js/jquery/jquery.selectbox-0.5.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('.styledselect').selectbox({ inputClass: "selectbox_styled" });
            });
        </script>
        <![endif]>
        <!--  styled select box script version 2 --> 
        <script src="../../../public/js/jquery/jquery.selectbox-0.5_style_2.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('.styledselect_form_1').selectbox({ inputClass: "styledselect_form_1" });
                $('.styledselect_form_2').selectbox({ inputClass: "styledselect_form_2" });
            });
        </script>
        <!--  styled select box script version 3 --> 
        <script src="../../../public/js/jquery/jquery.selectbox-0.5_style_2.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('.styledselect_pages').selectbox({ inputClass: "styledselect_pages" });
            });
        </script>
        <!-- Custom jquery scripts -->
        <script src="../../../public/js/jquery/custom_jquery.js" type="text/javascript"></script>
        <!-- Tooltips -->
        <script src="../../../public/js/jquery/jquery.tooltip.js" type="text/javascript"></script>
        <script src="../../../public/js/jquery/jquery.dimensions.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function() {
                $('a.info-tooltip ').tooltip({
                    track: true,
                    delay: 0,
                    fixPNG: true, 
                    showURL: false,
                    showBody: " - ",
                    top: -35,
                    left: 5
                });
            });
        </script> 

        <!-- MUST BE THE LAST SCRIPT IN <HEAD></HEAD></HEAD> png fix -->
        <script src="../../../public/js/jquery/jquery.pngFix.pack.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                $(document).pngFix( );
            });
        </script>
    </head>
    <body> 
        {banner}
        <div class="clear">&nbsp;</div>
        {menu}
        <div class="clear"></div>
        <div id="main_list_img_block">
            {list_img}
        </div>
        <div class="clear">&nbsp;</div>
        {footer}

    </body>
</html>